wayland: Move the buffer creation to the cairo surface creation
authorRob Bradford <rob@linux.intel.com>
Wed, 4 Apr 2012 13:05:57 +0000 (14:05 +0100)
committerRob Bradford <rob@linux.intel.com>
Mon, 16 Apr 2012 13:12:51 +0000 (14:12 +0100)
gdk/wayland/gdkwindow-wayland.c

index c2a4e4c23b2a8f141b9205161286f3484a4c6343..80ed791129625595824841c0d6ce5e825eb55ab5 100644 (file)
@@ -351,9 +351,6 @@ gdk_wayland_window_attach_image (GdkWindow *window)
   /* Get a Wayland buffer from this new surface */
   data = cairo_surface_get_user_data (impl->cairo_surface,
                                      &gdk_wayland_cairo_key);
-  if (!data->buffer)
-    data->buffer =
-      wl_egl_pixmap_create_buffer(data->pixmap);
 
   if (impl->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT)
     dx = server_width - data->width;
@@ -416,6 +413,10 @@ gdk_wayland_create_cairo_surface (GdkDisplayWayland *display,
   if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
     fprintf (stderr, "create gl surface failed\n");
 
+  if (!data->buffer)
+    data->buffer =
+      wl_egl_pixmap_create_buffer(data->pixmap);
+
   return surface;
 }